<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/formdiv.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/passcheck.js"></script>
[%if $defaultinput.mem_isaddress==1%]
<script type="text/javascript" src="js/cityselect.js"></script>
[%/if%]
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var membermain_js_password_empty  = "[%$ST.membermain_js_password_empty%]";
	var membermain_js_password_error  = "[%$ST.membermain_js_password_error%]";
	var membermain_js_email_empty  = "[%$ST.membermain_js_email_empty%]";
	var membermain_js_birthday_empty  = "[%$ST.membermain_js_birthday_empty%]";
	var membermain_js_zipcode_empty  = "[%$ST.membermain_js_zipcode_empty%]";
	var membermain_js_qq_empty  = "[%$ST.membermain_js_qq_empty%]";
	var membermain_js_edit_ok = "[%$ST.membermain_js_edit_ok%]";
	var membermain_js_edit_no = "[%$ST.membermain_js_edit_no%]";
	var membermain_js_integral_empty = "[%$ST.membermain_js_integral_empty%]";
	var password_err1 = "[%$ST.password_err1%]";
	var password_err2 = "[%$ST.password_err2%]";
	var password_err3 = "[%$ST.password_err3%]";
	var password_err4 = "[%$ST.password_err4%]";
	var password_err5 = "[%$ST.password_err5%]";
	var article_js_input_err  = "[%$ST.article_js_input_err%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		$('#password').ESPpasscheck({
			verdects:[password_err1,password_err2,password_err3,password_err4,password_err5]
		});
		var h = '[%$iframeheightwindow%]';
		$('.managebottonadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$('#memberedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
		[%if $defaultinput.mem_isaddress==1%]
		sec_cityone([%$memread.country%],[%$memread.province%]);
		sec_citytwo([%$memread.province%],[%$memread.city%]);
		sec_district([%$memread.city%],[%$memread.district%]);
		[%/if%]
		if (parent.document.getElementById('centerleft')){
			parent.scrolclear();
		}
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['password']!="") {
			if(get['password'].length<6) {
				document.memberedit.password.focus();
				alert(membermain_js_password_empty);
				return false;
			}
			if( get['password2'] != get['password'] ) {
				document.memberedit.password.focus();
				alert(membermain_js_password_error);
				return false;
			}
		}
		if(get['email'].match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/ig)==null) {
			document.memberedit.email.focus();
			alert(membermain_js_email_empty);
			return false;
		}
		if(get['birthday']!=""){
			if(get['birthday'].match(/^[1-9][0-9]{3}\-[0-9]{2}\-[0-9]{2}$/ig)==null) {
				document.memberedit.birthday.focus();
				alert(membermain_js_birthday_empty);
				return false;
			}
		}
		if(get['zipcode']!=""){
			if(get['zipcode'].match(/^[0-9]+$/ig)==null) {
				document.memberedit.zipcode.focus();
				alert(membermain_js_zipcode_empty);
				return false;
			}
		}
		if(get['integral']!=""){
			if(get['integral'].match(/^[0-9]+$/ig)==null) {
				document.memberedit.integral.focus();
				alert(membermain_js_integral_empty);
				return false;
			}
		}
		if(get['qq']!=""){
			if(get['qq'].match(/^[0-9]+$/ig)==null) {
				document.memberedit.qq.focus();
				alert(membermain_js_qq_empty);
				return false;
			}
		}
		[%forlist from=$modelatt key=list%]
			[%if ($modelatt[list].isvalidate==1)%]
			[%if ($modelatt[list].validatetext!='')%]
				if(get['[%$modelatt[list].attrname%]'].match([%$modelatt[list].validatetext%]ig)==null) {
			[%else%]
				if(get['[%$modelatt[list].attrname%]']==''){
			[%/if%]
				document.memberedit.[%$modelatt[list].attrname%].focus();
				alert('[%$modelatt[list].typename%]'+article_js_input_err);
				return false;
			}
			[%/if%]
		[%/forlist%]
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(membermain_js_edit_ok);
		}else{
			alert(membermain_js_edit_no+'Return message:'+options);
		}
		if (parent.document.getElementById('centerleft')){
			parent.scrolopen();
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="memberedit" id="memberedit" method="post" action="index.php?archive=membermain&action=membersave">
<input type="hidden" name="inputclass" value="edit">
<input type="hidden" name="userid" value="[%$memread.userid%]">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.membermain_edit_mess%] <u>[%$memread.username%] [%$memread.addtime|timeformat(3)%] </u></span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_add_username%]</td>
						<td width="85%" class="trtitle02">[%$memread.username%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_text_visitcount%]</td>
						<td width="85%" class="trtitle02">[%$memread.visitcount%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_edit_lastip%]</td>
						<td width="85%" class="trtitle02">[%$memread.lastip|ip(0)%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_text_lasttime%]</td>
						<td class="trtitle02">[%$memread.lasttime|timeformat(3)%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_edit_password%]</td>
						<td class="trtitle02">
							<input type="password" name="password" size="20" maxlength="16" class="infoInput" id="password">
							<span class="cautiontitle">[%$ST.membermain_edit_password_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_password2%]</td>
						<td class="trtitle02"><input type="password" name="password2" size="20" maxlength="16" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_passwordcheck%]：</td>
						<td class="trtitle02"><span id="passlist"></span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_email%]</td>
						<td class="trtitle02"><input type="text" name="email" maxlength="100" size="40" value="[%$memread.email%]" class="infoInput"></td>
					</tr>
					<tr class="trstyle2" id="select1">
						<td class="trtitle01">[%$ST.membermain_add_question%]</td>
						<td class="trtitle02"><input type="text" name="question" maxlength="100" size="40" value="[%$memread.question%]" class="infoInput"><span class="cautiontitle">[%$ST.membermain_add_question_mess%]</span></td>
					</tr>
					<tr class="trstyle2" id="select2">
						<td class="trtitle01">[%$ST.membermain_add_answer%]</td>
						<td class="trtitle02"><input type="text" name="answer" maxlength="100" size="40" value="[%$memread.answer%]" class="infoInput"></td>
					</tr>
					<tr class="trstyle2" id="select2">
						<td class="trtitle01">[%$ST.membermain_add_integral%]</td>
						<td class="trtitle02"><input type="text" name="integral" maxlength="5" size="5" value="[%$memread.integral%]" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.membermain_add_mcid%]</td>
						<td width="85%" class="trtitle02">
							<select name="mcid" id="mcid">
								[%forlist from=$memberpuvlist key=i%]
								<option [%$memberpuvlist[i].selected%] value="[%$memberpuvlist[i].mcid%]">[%$memberpuvlist[i].rankname%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle03" colspan="2">[%$ST.membermain_add_countustype%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01" width="15%">[%$ST.membermain_add_alias%]</td>
						<td class="trtitle02" width="85%"><input type="text" value="[%$memread.alias%]" name="alias" maxlength="80" size="50" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_sex%]</td>
						<td class="trtitle02">
							<input type="radio" value="1" name="sex"[%if $memread.sex==1%] checked="checked"[%/if%]> [%$ST.select_sex_1%]&nbsp;
							<input type="radio" value="0" name="sex"[%if $memread.sex==0%] checked="checked"[%/if%]> [%$ST.select_sex_0%]
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_tel%]</td>
						<td class="trtitle02"><input type="text" name="tel" maxlength="20" value="[%$memread.tel%]" size="50" class="infoInput"><span class="cautiontitle">[%$ST.membermain_add_tel_mess%]</span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_motel%]</td>
						<td class="trtitle02"><input type="text" name="mobile" value="[%$memread.mobile%]" maxlength="20" size="50" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_birthday%]</td>
						<td class="trtitle02">
							<input type="text" name="birthday" id="birthday" value="[%$memread.birthday|timeformat(2)%]" maxlength="20" size="20" class="infoInput">
							<a class="datetime" onclick="WdatePicker({el:'birthday',readOnly:true,dateFmt:'yyyy-MM-dd'})" href="#body">[%$ST.selectdata_botton%]</a>
						</td>
					</tr>
					[%if $defaultinput.mem_isaddress==1%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_country%]</td>
						<td class="trtitle02">
							<select size="1" name="cityone" class="select" id="cityone">
								<option [%if $memread.country==0%]selected [%/if%]value="0">[%$ST.membermain_add_country_option%]</option>
								<option [%if $memread.country==1%]selected [%/if%]value="1">[%$ST.membermain_add_country_value%]</option>
							</select>
							<select size="1" name="citytwo" class="select" id="citytwo">
								<option selected value="0">[%$ST.membermain_add_province_option%]</option>
							</select>
							<select size="1" name="citythree" class="select" id="citythree">
								<option selected value="0">[%$ST.membermain_add_city_option%]</option>
							</select>
							<select size="1" name="district" class="select" id="district">
								<option selected value="0">[%$ST.membermain_add_district_option%]</option>
							</select>
							<span id="cityloading">Loading…</span>
						</td>
					</tr>
					[%/if%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_address%]</td>
						<td class="trtitle02"><input type="text" name="address" value="[%$memread.address%]" maxlength="120" size="80" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_zipcode%]</td>
						<td class="trtitle02"><input type="text" name="zipcode" value="[%$memread.zipcode%]" maxlength="10" size="50" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_msn%]</td>
						<td class="trtitle02"><input type="text" name="msn" value="[%$memread.msn%]" maxlength="50" size="50" class="infoInput"></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.membermain_add_qq%]</td>
						<td class="trtitle02"><input type="text" name="qq" value="[%$memread.qq%]" maxlength="10" size="50" class="infoInput"></td>
					</tr>
					[%if count($modelatt) > 0%]
						[%forlist from=$modelatt key=list%]
							<tr class="trstyle2">
								<td class="trtitle01">[%$modelatt[list].typename%]</td>
								<td class="trtitle02">
									[%if $modelatt[list].inputtype=='string' || $modelatt[list].inputtype=='int' || $modelatt[list].inputtype=='float' || $modelatt[list].inputtype=='decimal'%]
									<input type="text" name="[%$modelatt[list].attrname%]" size="[%$modelatt[list].attrsize%]" id="[%$modelatt[list].attrname%]" value="[%$modelatt[list].attrvalue%]" maxlength="[%$modelatt[list].attrlenther%]" class="infoInput"/>
									[%elseif ($modelatt[list].inputtype=='text' || $modelatt[list].inputtype=='editor')%]
									<textarea name="[%$modelatt[list].attrname%]" id="[%$modelatt[list].attrname%]"  style="width:99%;height:[%$modelatt[list].attrrow%]px;" class="infoInput">[%$modelatt[list].attrvalue%]</textarea>
									[%elseif ($modelatt[list].inputtype=='htmltext')%]
									<textarea name="[%$modelatt[list].attrname%]" id="[%$modelatt[list].attrname%]"  style="width:99%;height:[%$modelatt[list].attrrow%]px;" class="infoInput">[%$modelatt[list].attrvalue|Html2Text('0')%]</textarea>
									[%elseif ($modelatt[list].inputtype=='selectinput')%]
									<input type="text" name="[%$modelatt[list].attrname%]" size="[%$modelatt[list].attrsize%]" id="[%$modelatt[list].attrname%]" value="[%$modelatt[list].attrvalue%]" maxlength="[%$modelatt[list].attrlenther%]" class="infoInput"/>
									<select size="1" name="[%$modelatt[list].attrname%]selectinputvalue" onchange="javascript:$('#[%$modelatt[list].attrname%]').val(this.value)">
										<option value="">[%$ST.botton_select_name%][%$modelatt[list].typename%]</option>
										[%forlist from=$modelatt[list].selectinputvalue key=ii%]
										<option value="[%$modelatt[list].selectinputvalue[ii].name%]">[%$modelatt[list].selectinputvalue[ii].name%]</option>
										[%/forlist%]
									</select>
									[%elseif ($modelatt[list].inputtype=='datetime')%]
									<input type="text" name="[%$modelatt[list].attrname%]" size="[%$modelatt[list].attrsize%]" id="[%$modelatt[list].attrname%]" value="[%$modelatt[list].attrvalue|timeformat(3)%]" maxlength="[%$modelatt[list].attrlenther%]" class="infoInput"/>
									<a class="datetime" onclick="WdatePicker({el:'[%$modelatt[list].attrname%]',readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" href="#body">[%$ST.selectdata_botton%]</a>
									[%elseif ($modelatt[list].inputtype=='select')%]
									<select size="1" name="[%$modelatt[list].attrname%]" id="[%$modelatt[list].attrname%]">
										<option value="">[%$ST.botton_select_name%][%$modelatt[list].typename%]</option>
										[%forlist from=$modelatt[list].attrvalue key=ii%]
										<option [%$modelatt[list].attrvalue[ii].selected%] value="[%$modelatt[list].attrvalue[ii].name%]">[%$modelatt[list].attrvalue[ii].name%]</option>
										[%/forlist%]
									</select>
									[%elseif ($modelatt[list].inputtype=='radio')%]
										[%forlist from=$modelatt[list].attrvalue key=ii%]
										<input type="radio" value="[%$modelatt[list].attrvalue[ii].name%]" name="[%$modelatt[list].attrname%]" [%if $modelatt[list].attrvalue[ii].selected=='selected'%]checked="checked"[%/if%]/> [%$modelatt[list].attrvalue[ii].name%]&nbsp;
										[%/forlist%]
									[%elseif ($modelatt[list].inputtype=='checkbox')%]
										[%forlist from=$modelatt[list].attrvalue key=ii%]
										<input type="checkbox" value="[%$modelatt[list].attrvalue[ii].name%]" name="[%$modelatt[list].attrname%][]" [%if $modelatt[list].attrvalue[ii].selected=='selected'%]checked="checked"[%/if%]/> [%$modelatt[list].attrvalue[ii].name%]&nbsp;
										[%/forlist%]
									[%/if%]
									[%if $modelatt[list].typeremark!=''%]<span class="cautiontitle">[%$modelatt[list].typeremark%]</span>[%/if%]
								</td>
							</tr>
						[%/forlist%]
					[%/if%]
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" name="Submit" value="[%$ST.botton_edit%]" class="button orange" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:closewindow();" value="[%$ST.botton_edit_reset%]" class="button orange" /></td>
			</tr>
		</table>
	</div>
</div>
<input type="hidden" name="mvid" value="[%$memread.mvid%]">
<input type="hidden" name="lng" value="[%$lng%]">
<input type="hidden" name="username" value="[%$memread.username%]">
<input type="hidden" name="passwordold" value="[%$memread.password%]">
</form>
</body>

</html>